import request from '@/config/axios'

export interface UserAnalysisVO {
  id: number
  userId: number
  answerNo: number
  analysisContent: string
  createTime: string
}

export interface UserAnalysisRespVO {
  list: UserAnalysisVO[]
  total: number
}

// 用户分析 API
export const UserAnalysisApi = {
  // 创建用户分析
  createUserAnalysis(data: UserAnalysisVO) {
    return request.post({ url: '/analysis/user-analysis/create', data })
  },
  // 更新用户分析
  updateUserAnalysis(data: UserAnalysisVO) {
    return request.put({ url: '/analysis/user-analysis/update', data })
  },
  // 删除用户分析
  deleteUserAnalysis(id: number) {
    return request.delete({ url: `/analysis/user-analysis/delete?id=${id}` })
  },
  // 获得用户分析
  getUserAnalysis(id: number) {
    return request.get<UserAnalysisVO>({ url: `/analysis/user-analysis/get?id=${id}` })
  },
  // 获得用户分析分页
  getUserAnalysisPage(params: any) {
    return request.get<UserAnalysisRespVO>({ url: '/analysis/user-analysis/page', params })
  },
  // 导出用户分析 Excel
  exportUserAnalysis(params: any) {
    return request.download({ url: '/analysis/user-analysis/export-excel', params })
  }
}
